home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / menus / marxmenu / login.mnu < prev    next >
Text File  |  1996-07-10  |  21KB  |  856 lines

  1. Comment
  2. ========================================================
  3.  
  4. Copyright 1990-92 by Marc Perkel * All right reserved.
  5.  
  6. MarxMenu now allows you to login to a Novell network without using
  7. Novell's login program or messing with nasty login scripts. You can
  8. be in MarxMenu all the way in.
  9.  
  10. Before you start on this make sure you have read the Novell section of
  11. the MarxMenu manual. This menu is somewhat tricky and requires some
  12. study before you dive right in.
  13.  
  14. Logging into Novell is tricky. Especially if you are using boot roms
  15. on your network cards. Through much trial and error, I have found
  16. some solid tricks that make life easier.
  17.  
  18. You should have the following two BATCH files in your LOGIN
  19. directory as follows:
  20.  
  21. LOADNET.BAT  ;if used with BESTNET
  22. -----------
  23. @Echo Off
  24. %NET%
  25. %NETD%
  26. Set NET=
  27. Set NETD=
  28. Startup
  29.  
  30. LOADNET.BAT  ;if not used with BESTNET
  31. -----------
  32. @Echo Off
  33. NETX
  34. F:
  35. Startup
  36.  
  37. STARTUP.BAT
  38. -----------
  39. SET BOOTUP=LOGIN
  40. MarxMenu Login
  41. %BOOTUP%
  42.  
  43. Each workstation should have their own AUTOEXEC.BAT. The last line
  44. should be LOADNET. If you are running multiple versions of dos or a
  45. variety of computers you should run BESTNET as part of your bootup
  46. sequence.
  47.  
  48. Also, if you want automatic login you can add the following lines to you
  49. AUTOEXEC.BAT file:
  50.  
  51. SET USERNAME=MARC   Your Name Here
  52. SET PASSWORD=NERD   Your Password Here
  53.  
  54. You should also change the COMSPEC= to the network command.com BEFORE
  55. you run NETX. For some unknown reason, this solves a lot of problems.
  56.  
  57. Example:
  58.  
  59. IPX
  60. SET COMSPEC=O:COMMAMD.COM
  61. NETX
  62.  
  63. Another boot rom quirk is that you can't run any program off a boot
  64. rom that trashes upper memory. An example is running QEMM on a
  65. monochrome monitor.
  66.  
  67. By using this method the boot disk or boot rom hands control over in
  68. a clean way. LOADNET.BAT then branches to STARTUP.BAT for the rest
  69. of the login sequence.
  70.  
  71. For some strange reason which I can't explain, LOADNET and STARTUP
  72. have to be two separate batch files. I think it forces the transient
  73. part of COMMAND.COM to load into memory. Anyhow, don't combine these
  74. into one batch file
  75.  
  76. The first line of STARTUP.BAT is a message that tells this menu that
  77. the user is logging in for the first time. This menu creates a batch
  78. file and puts the name of it in the environment variable BOOTUP.
  79. STARTUP.BAT then executes this file.
  80.  
  81. This is the example for MY network. You'll have to modify it for
  82. yours. I'm doing a lot of tricky things in my login. Your login might
  83. not need to be as complex as mine.
  84.  
  85. One word of caution. After modifing this menu, always run MARXCOMP
  86. LOGIN to compile it. Otherwise, if you boot up into it you won't
  87. have enough access rights to recompile automatically. I do this by
  88. making a file called L.BAT.
  89.  
  90. ME LOGIN.MNU
  91. MARXCOMP LOGIN.MNU
  92.  
  93. ========================================================
  94. EndComment
  95.  
  96. var
  97.    UserName
  98.    OldPass
  99.    NewPass
  100.    Logged
  101.    Station
  102.    NetAddress
  103.    SmartDir
  104.    MyServer
  105.    OrigServer
  106.    HomeDir
  107.    DosDir
  108.    UseMarxLogin
  109.    Shell
  110.    PasswordExpDays
  111.    SkipError
  112.    Servers
  113.    StatusWin
  114.    TsrLoaded
  115.  
  116. Comment
  117. ========================================================
  118.  
  119. If UseMarxLogin is set to true then this program will use the MarxMenu
  120. API call to log into the network. If set to false the it will shell
  121. Novell's LOGIN.EXE program.
  122.  
  123. If UseMarxLogin is set to true, and you are using 386 NetWare then you
  124. will have to add the following command to your AUTOEXEC.NCF file:
  125.  
  126. SET ALLOW UNENCRYPTED PASSWORDS = ON
  127.  
  128. ========================================================
  129. EndComment
  130.  
  131. UseMarxLogin = True
  132.  
  133. Shell = CleanFileName(ReadEnv('COMSPEC'))
  134. MyServer = NovDefaultServer
  135. OrigServer = MyServer
  136. NovServers(Servers)
  137. Logged = ReadEnv('LOGGED') = 'TRUE'
  138.  
  139. SkipError = False
  140.  
  141. TryAutoLogin
  142. if not Logged then LoginFromScreen
  143.  
  144. NovSetPrimaryServer (MyServer)
  145. NovSetPreferredServer (MyServer)
  146.  
  147. UserName = NovMyLoginName
  148. SetEnv ('LOGGED=')
  149. SetEnv ('USERNAME=' + UserName)
  150. SetEnv ('PASSWORD=')
  151.  
  152. ;----- Another Server Selected
  153.  
  154. if MyServer <> OrigServer
  155.    SetEnv ('BOOTUP=STARTUP')
  156.    SetEnv ('LOGGED=TRUE')
  157.    NovMapDrive('F',MyServer + '/SYS:LOGIN')
  158.    ChDir('F:\LOGIN')
  159.    ExitMenu
  160. endif
  161.  
  162. ;----- You can't assume that you have an F: drive unless you map it.
  163.  
  164. NovMapDrive ('F','SYS:\LOGIN')
  165.  
  166. Comment
  167. ========================================================
  168.  
  169. If a TEMP environment variable is set, MarxMenu will use it for
  170. temporary batch files. This is compatible with DOS 5 and Windows
  171. conventions. The users should be given full access rights to this
  172. directory. I'm using \TMPFILES for my network.
  173.  
  174. ========================================================
  175. EndComment
  176.  
  177. if ExistDir('F:\TMPFILES') then SetEnv('TEMP=F:\TMPFILES')
  178.  
  179. ;----- Here we calculate a home directory for each user.
  180.  
  181. HomeDir = 'F:\HOME\' + UserName
  182. if UserName = 'SUPERVISOR' then HomeDir = 'F:\SYSTEM'
  183. if not ExistDir(HomeDir) then HomeDir = 'F:\PUBLIC\UTIL'
  184.  
  185. Comment
  186. ========================================================
  187.  
  188. Here we calulate the the name of the dos directory that matches the
  189. version of dos we are running. The directory for DOS 5.0 would be
  190. F:\PUBLIC\DOSV5.00
  191.  
  192. ========================================================
  193. EndComment
  194.  
  195. DosDir = 'F:\PUBLIC\DOSV' + DosVersionString
  196.  
  197. ;----- DR DOS (NovOS)
  198.  
  199. if ReadEnv('OS') > ''
  200.    DosDir = 'F:\PUBLIC\' + ReadEnv('OS') + ReadEnv('VER')
  201. endif
  202.  
  203. Comment
  204. ========================================================
  205.  
  206. Here's where we map our drives. This does not set the search path.
  207. You set that explicitly by writing to the PATH environment variable.
  208.  
  209. Drive map commands may contain server and volume referrences:
  210.  
  211. ========================================================
  212. EndComment
  213.  
  214. NovMapRoot ('H', HomeDir)           ;Home Directory
  215. NovMapRoot ('N','F:\PUBLIC\NSK')    ;Network Survival Kit
  216. NovMapRoot ('O', DosDir)            ;Dos Directory
  217. NovMapRoot ('U','F:\PUBLIC\UTIL')   ;Utilities Directory
  218. NovMapRoot ('P','F:\PUBLIC')        ;Public Directory
  219. NovMapRoot ('L','F:\LOGIN')         ;Login Directory
  220.  
  221. Comment
  222. ========================================================
  223.  
  224. Here we set a different directory for a program depending on if we
  225. have a color or monochrome monitor.
  226.  
  227. ========================================================
  228. EndComment
  229.  
  230. if VideoMode = Mono
  231.    SmartDir = 'F:\PUBLIC\MSMART'
  232. else
  233.    SmartDir = 'F:\PUBLIC\CSMART'
  234. endif
  235.  
  236. if ExistDir SmartDir
  237.    NovMapRoot ('S',SmartDir)
  238. endif
  239.  
  240. Comment
  241. ========================================================
  242.  
  243. W: is a work drive. When an application needs an extra search path, I
  244. move W: to that directory.
  245.  
  246.  OnKey 'L'
  247.    |NovMapRoot('W','\PUBLIC\LOTUS')
  248.    Lotus
  249.  
  250. ========================================================
  251. EndComment
  252.  
  253. NovMapRoot('W','H:')
  254.  
  255. if NovConsoleOperator
  256.    NovMapRoot ('V','F:\SYSTEM')     ;System Directory
  257. endif
  258.  
  259. if MyServer = 'TYME'
  260.    NovMapDrive ('I','VOL1:')
  261.  
  262.    ;----- Here's where I log into a second server.
  263.  
  264.    if PosInList('TYME2',Servers) > 0
  265.       NovLogin('TYME2/' + UserName,OldPass)
  266.       NovMapDrive('K','TYME2/SYS:')
  267.    endif
  268.  
  269.    ;----- Here's where I log into a third server.
  270.  
  271.    if PosInList('TSS',Servers) > 0
  272.       NovLogin('TSS/' + UserName,OldPass)
  273.       NovMapDrive('J','TSS/SYS:')
  274.    endif
  275.  
  276.    ;----- Here's where I log into another server.
  277.  
  278.    if PosInList('MARX',Servers) > 0
  279.       NovLogin('MARX/' + UserName,OldPass)
  280.       NovMapDrive('G','MARX/SYS:')
  281.    endif
  282.  
  283. endif
  284.  
  285. ;----- Turbo Pascal 6
  286.  
  287. if ExistDir ('H:\TP6') then NovMapRoot ('T','H:\TP6')
  288.  
  289. ;----- If no drive C then use home directory
  290.  
  291. if Floppies < 3                     ;I'm using some 4 floppy machines
  292.    if not ExistDir ('C:\') then NovMapRoot('C','H:')
  293. else
  294.    NovMapRoot('C','H:')
  295. endif
  296.  
  297. ;----- Here we define our search paths.
  298.  
  299. SetEnv ('PATH=T:\;H:\;W:\;U:\;N:\;O:\;P:\;V:\;S:\;')
  300.  
  301. FixPath    ;Verifies all search paths exist
  302.  
  303. ChDir (HomeDir)
  304.  
  305. ;----- Here's where we set master environment variable strings
  306.  
  307. SetEnv ('STATION=' + Station)
  308. if Left(Shell,2) <> 'C:' then SetEnv ('COMSPEC=O:\COMMAND.COM')
  309. SetEnv ('PROMPT=$e[1;33m$p: $e[0;32m')  ;ansi required
  310. SetEnv ('MXECHO=OFF')
  311.  
  312. ;----- Here's where I set up for Pick Directory
  313.  
  314. if UserName <> 'MARC'
  315.    SetEnv ('PD.EXE=/$F:\HOME\PD.PIC')
  316. else
  317.    SetEnv ('PD.EXE=/$H:\PD.PIC')
  318. endif
  319.  
  320. Comment
  321. ========================================================
  322.  
  323. Opens a semaphore that XMETER can read.
  324. To see how many users are users are on with XMETER type:
  325. XMETER LOGIN /U
  326.  
  327. ========================================================
  328. EndComment
  329.  
  330. NovOpenSemaphore ('XM-LOGIN',0)
  331.  
  332. ;----- Turn NumLock key on if in NumLock group.
  333.  
  334. if NovInGroup('NUMLOCK')
  335.    NumLock On
  336. else
  337.    NumLock Off
  338. endif
  339.  
  340. ;----- LOGIN is set to BOOTUP if logging in for the first time
  341.  
  342. if UpperCase(ReadEnv('BOOTUP')) <> 'LOGN' then ExitMenu
  343.  
  344. Comment
  345. ========================================================
  346.  
  347. In order to load TSRs, MarxMenu writes a temporary batch file and
  348. exits. The STARTUP.BAT file then jumps to this batch file.
  349.  
  350. ========================================================
  351. EndComment
  352.  
  353. ;----- Create temporary batch file for rest of login sequence
  354.  
  355. SetEnv ('BOOTUP=' + BatFileName)
  356.  
  357. ;----- To debug, set ECHO ON and add PAUSE commands
  358.  
  359. if DosVersionString < '3.30'
  360.    Bat('ECHO OFF')
  361. else
  362.    Bat('@ECHO OFF')
  363. endif
  364.  
  365. Bat ('SET BOOTUP=')     ;clear BOOTUP environment variable
  366.  
  367. ;----- Set BREAK to ON if NovConsoleOperator
  368.  
  369. if NovConsoleOperator then Bat('BREAK ON')
  370.  
  371. Comment
  372. ========================================================
  373.  
  374. Here's where we load up all the TSRs the user is going to use. We set
  375. the environment variable TSR to Y to indicate that TSRs are loaded. This
  376. way if we log out and then back in we won't load them twice.
  377.  
  378. ========================================================
  379. EndComment
  380.  
  381. TsrLoaded = ReadEnv('TSR') = 'Y'
  382.  
  383. if not TsrLoaded
  384.  
  385.    SetEnv ('TSR=Y')
  386.  
  387.    ;----- Load CastAway
  388.  
  389.    if NovInGroup ('CASTAWAY')
  390.       Bat ('P:\EXPR\CASTAWAY N /W=0 /I=0 /H')
  391.    endif
  392.  
  393.    ;----- Load ExpressIT Mail System
  394.  
  395.    if NovInGroup ('EXPRESSIT')
  396.       Bat ('P:\EXPR\EXPRESS F12')
  397.    endif
  398.  
  399.    ;----- Load Lan Assist
  400.  
  401.    if NovInGroup ('LANASSIST')
  402.       if NovInGroup ('LA-RES')
  403.          Bat ('F:\PUBLIC\QEMM\LOADHI P:LA\LA /L >NUL')
  404.       else
  405.          Bat ('F:\PUBLIC\QEMM\LOADHI P:LA\LA +N >NUL')
  406.       endif
  407.    endif
  408.  
  409.    ;----- Load SideKick if in Sidekick Group
  410.  
  411.    if NovInGroup 'SIDEKICK'
  412.       Bat ('KBD CR')
  413.       Bat ('P:\QEMM\LOADHI SWAPSK/N/G/D' + HomeDir + ' >NUL')
  414.       Bat ('SK')
  415.       Bat ('CLS')
  416.    endif
  417.  
  418.    ;----- Load SideKick 2 if in SK2 Group
  419.  
  420.    if NovInGroup 'SK2'
  421.       Bat ('P:\QEMM\LOADHI P:\SK2\SK2')
  422.    endif
  423.  
  424.  
  425. endif
  426.  
  427. Capture('LASER',2)
  428.  
  429. Comment
  430. ================================================================
  431.  
  432. This next section deals with running special programs bases on the
  433. physical station number rather than by user. This deals with special
  434. hardware that needs software drivers loaded.
  435.  
  436. ================================================================
  437. EndComment
  438.  
  439. ;----- CD ROM Machine
  440.  
  441. ;if NetAddress = '255:2'
  442. ;   Bat ('CD\PUBLIC\MA')
  443. ;   Bat ('MSCDEX.EXE /D:MSCD003 /M:12')
  444. ;   Bat ('MAR C:\ RW=/ /C')
  445. ;endif
  446.  
  447. ;if (NetAddress = '255:C3') or (NetAddress = '254:C3')
  448. ;   Bat('MODE BW80')
  449. ;endif
  450.  
  451. ;----- Set Keyboard Speed Faster if 286 or greater.
  452.  
  453. if CPUClass > 1 then Bat('KBD 6')
  454.  
  455. Comment
  456. ================================================================
  457.  
  458. This next section deals with running special programs bases on the
  459. users preferrences.
  460.  
  461. ================================================================
  462. EndComment
  463.  
  464. if UserName = 'MARC'
  465.    Capture('DOT',1)
  466.    ChDir('TP6')
  467. endif
  468.  
  469. if UserName = 'VICKI'
  470.    if not TsrLoaded then Bat('P:\QEMM\LOADHI MOUSE')
  471. endif
  472.  
  473. if UserName = 'KEVIN'
  474.    Capture('DOT',2)
  475.    SetEnv('PROMPT=($p)')
  476.    SetEnv('PATH=' + ReadEnv( 'Path' ) + ';f:\home\kevin\brief' )
  477.    ChDir('MARX')
  478. endif
  479.  
  480. if UserName = '386'
  481.    Capture('DOT',1)
  482. endif
  483.  
  484. if UserName = 'TBBS'
  485.    Capture('DOT',1)
  486.    ChDir('I:\BBS\TBBS')
  487.    NovMapDrive('H','I:')
  488.    SetEnv('D.EXE=/O/I')
  489.    Bat('CASTOFF')
  490.    Bat('DROPTO R1')
  491. endif
  492.  
  493. if UserName = 'GRACE'
  494.    Bat('KBD 6 NumOn');
  495. endif
  496.  
  497. if UserName = 'WORK'
  498.    Capture('DOT',1)
  499. endif
  500.  
  501. if UserName = 'LITE'
  502.    Capture('DOT',1)
  503.    NovMapRoot('W','P:\BITFAX')
  504.    Bat('P:\QEMM\LOADHI BITSCHED')
  505.    Bat('P:\QEMM\LOADHI RECVFAX')
  506.    if AfterHours
  507.       BAT('CD\PUBLIC\AWHOST')
  508.       BAT('AWHOST -M=W')
  509.       BAT('BATEXIT')
  510.    else
  511.       BAT('CD\PUBLIC\BITFAX')
  512.       BAT('MARXMENU SFAX')
  513.       BAT('BATEXIT')
  514.    endif
  515. endif
  516.  
  517. Comment
  518. ================================================================
  519.  
  520. The batch file ends by jumping to personal menu, if there is one, or
  521. the default menu if there isn't. DROPTO.BAT is used to erase the
  522. temporary batch file that this menu creates.
  523.  
  524. ================================================================
  525. EndComment
  526.  
  527. if ExistFile ('F:\HOME\' + UserName + '\' + UserName + '.MNU')
  528.    Bat ('DROPTO MARX ' + UserName)
  529. endif
  530.  
  531. Bat ('DROPTO MARX TYME')
  532.  
  533. ExitMenu
  534.  
  535. ;===============================================================
  536. ;===============================================================
  537.  
  538. ;----- Procedure Definitions
  539.  
  540. Procedure Capture (Queue, PrinterPort)
  541.    NovCaptureQueue(PrinterPort) = Queue
  542.    NovCaptureTimeOut(PrinterPort) = 5     ;5 second timeout
  543. EndProc
  544.  
  545.  
  546. Comment
  547. ========================================================
  548.  
  549. If Environment variables USERNAME and PASSWORD are set, this menu
  550. will attempt to log into the network using these values. This allows
  551. for automatic login. You can also pass the parameters on the command
  552. line as follows.
  553.  
  554. MarxMenu Login <Name> <Password>
  555.  
  556. The name may contain a referrence to a server: Server/Name
  557.  
  558. ========================================================
  559. EndComment
  560.  
  561. ;----- If CapsLock key is on then override default login
  562.  
  563. ;----- Try Automatic Login using Environment Variables
  564.  
  565. Procedure TryAutoLogin
  566.    if Logged then Return
  567.    if CapsLock
  568.       CapsLock Off
  569.    else
  570.       UserName = ParamStr(2)
  571.       if UserName = '' then UserName = ReadEnv('USERNAME')
  572.       if UserName > ''
  573.          OldPass = ParamStr(3)
  574.          if OldPass = '' then OldPass = ReadEnv('PASSWORD')
  575.          if OldPass > ''
  576.             SkipError = True
  577.             Login (UserName,OldPass)
  578.             SkipError = False
  579.             if PasswordNeedsChanged
  580.                Logged = False
  581.                Suggest 'C'
  582.             endif
  583.          endif
  584.       endif
  585.    endif
  586. EndProc
  587.  
  588. ;----- Select colors and prepare screen
  589.  
  590. Procedure LoginFromScreen
  591.    if ColorScreen
  592.       TextColor White Red
  593.       BoxBorderColor Green Brown
  594.       BoxInsideColor Black Brown
  595.       ClearScreen 176
  596.       ClockColor Black Brown
  597.       TextColor Black Green
  598.       BoxHeaderColor Yellow Mag
  599.       Shadow
  600.    else
  601.       TextColor Grey Black
  602.       ClearScreen 176
  603.       TextColor Black Grey
  604.       BoxBorderColor Black Grey
  605.       BoxInsideColor Black Grey
  606.       BoxHeaderColor Black Grey
  607.       ClockColor Black Grey
  608.    endif
  609.    BlankMessage = 'Netware Login'
  610.    ClockMode = 262
  611.    GotoXY 1 25
  612.    ClearLine
  613.    WriteCenter "Computer Tyme Master Network Login Menu"
  614.    SingleLineBox
  615.    Explode Off
  616.    ShadowColor Grey Red
  617.    if ColorScreen
  618.       DrawBox 3 2 74 5
  619.       ClockPos 42 5
  620.       TextColor Blue Brown
  621.    else
  622.       DrawBox 3 2 76 5
  623.       ClockPos 44 5
  624.    endif
  625.    WriteCenter 'Computer Tyme Software Development Laboratory'
  626.    Writeln
  627.    TextColor Black Brown
  628.    WriteCenter '───────────────────────────────────────────────────────'
  629.    Writeln
  630.    TextColor Black Brown
  631.    Write "  (C) 1990-92 by Marc Perkel"
  632.    DoubleLineBox
  633.    BlankTime = 10
  634.  
  635.    Explode On
  636.    BlockBox
  637.    BoxBorderColor Green Blue
  638.    BoxInsideColor Yellow Blue
  639.    BoxHeader = " Station Information "
  640.    if ColorScreen
  641.       DrawBox 39 17 38 6
  642.       TextColor Yellow Blue
  643.    else
  644.       DrawBox 41 17 38 6
  645.       TextColor Grey Black
  646.    endif
  647.    StatusWin = CurrentWindow
  648.    UpdateStatusWindow
  649.  
  650.    ChooseOption
  651.  
  652.    EraseTopWindow
  653.    EraseTopWindow
  654.    EraseTopWindow
  655.    TextColor Grey Black
  656.    ClearScreen
  657. EndProc
  658.  
  659.  
  660. Procedure ChooseOption
  661. var Ch X
  662.    repeat
  663.       X = 4
  664.       if NumberOfElements(Servers) > 1 then X = 5
  665.       DrawBox 3 17 26 X
  666.       UseArrows
  667.       OnScreenOnly
  668.       InverseColor Yellow Cyan
  669.       Writeln '  L - Login to Network'
  670.       Write   '  C - Change Password'
  671.       if NumberOfElements(Servers) > 1
  672.          Writeln
  673.          Write   '  S - Select Server'
  674.       endif
  675.       Ch = UpperCase(ReadKey)
  676.       if (Ch = 'L') or (Ch = 'C') or (Ch = 'S')
  677.          EraseTopWindow
  678.          if Ch = 'L'
  679.             LoginToNetwork (False)
  680.          endif
  681.          if Ch = 'C'
  682.             LoginToNetwork (True)
  683.          endif
  684.          if Ch = 'S'
  685.             SelectServer
  686.          endif
  687.       endif
  688.    until Logged
  689. EndProc
  690.  
  691.  
  692. Procedure Warning (St)
  693.    BoxHeader ' Warning '
  694.    DrawBox 3 17 length(St) + 4 3
  695.    Write Char(7) ' ' St
  696.    Wait 300
  697.    EraseTopWindow
  698. EndProc
  699.  
  700.  
  701. Procedure LoginToNetwork (CP)
  702. var NewPassVerify
  703.    BoxHeader = ' Logging into Server * ' + MyServer + ' '
  704.    DrawBox 3 10 50 4
  705.    UseArrows Off
  706.    Security
  707.    repeat
  708.       if UserName = ''
  709.          Write ' Name: '
  710.          UserName = UpperCase(Readln)
  711.          Writeln
  712.       endif
  713.       Write ' Password: '
  714.       OldPass = UpperCase(Readln)
  715.       Write CR
  716.       ClearLine
  717.       Login (UserName,OldPass)
  718.       if not CP
  719.          CP = PasswordNeedsChanged
  720.          if CP then Warning('Time to change your password!')
  721.       endif
  722.       if CP
  723.          if LastKey <> Esc
  724.             repeat
  725.                Write ' New Password: '
  726.                NewPass = UpperCase(Readln)
  727.                Write CR
  728.                ClearLine
  729.                if NewPass = OldPass then Warning('Select a NEW Password!')
  730.             until NewPass <> OldPass
  731.          endif
  732.          if LastKey <> Esc
  733.             Write ' Verify: '
  734.             NewPassVerify = UpperCase(Readln)
  735.             Write CR
  736.             ClearLine
  737.             if NewPass = NewPassVerify
  738.                NovChangePassword (OldPass,NewPass)
  739.                if NovResult <> 0
  740.                   Warning ('Password Change Failed!')
  741.                   Logged = False
  742.                endif
  743.             else
  744.                Warning('Password Typed Wrong!')
  745.                Logged = False
  746.             endif
  747.          endif
  748.       endif
  749.    ClearScreen
  750.    if not Logged
  751.       UserName = ''
  752.    endif
  753.    until (LastKey = Esc) or Logged
  754.    EraseTopWindow
  755. EndProc
  756.  
  757.  
  758. Procedure Login (User, Pass)
  759.    if UseMarxLogin
  760.       NovLogin (MyServer + '/' + User, Pass)
  761.       if NovResult = 223 then NovResult = 0  ;grace login
  762.       Logged = NovResult = 0
  763.       if Logged
  764.          NovMapDrive('F',MyServer + '/SYS:LOGIN')
  765.       endif
  766.    else
  767.       ClearScreenFirst Off
  768.       UseCommand On
  769.       StuffKbd = Pass + CR
  770.       Execute ('LOGIN.EXE ' + MyServer + '/' + User + '>nul')
  771.       Logged = ExistDir ('F:\SYSTEM')
  772.    endif
  773.    if not Logged and not SkipError
  774.  
  775.       if NovResult = 254
  776.          Warning('All Logins Disabled!')
  777.  
  778.       elseif NovResult = 222
  779.          Warning('Password Expired!')
  780.  
  781.       elseif NovResult = 252
  782.          Warning('Invalid User Name!')
  783.  
  784.       elseif NovResult = 220
  785.          Warning('Account Disabled!')
  786.  
  787.       elseif (NovResult = 218) or (NovResult = 219)
  788.          Warning('Invalid Login Time!')
  789.  
  790.       elseif NovResult = 197
  791.          Warning('Intruder Lockout!')
  792.  
  793.       elseif NovResult = 255
  794.          Warning('Bad Password!')
  795.  
  796.       else
  797.          Warning('Login Failed! '+ Str(NovResult))
  798.  
  799.       endif
  800.  
  801.    endif
  802. EndProc
  803.  
  804.  
  805. Procedure PasswordNeedsChanged
  806. var X
  807.    X = NovPasswordExpDate (UserName)
  808.    if X = 0 then Return False
  809.    Return (X - Today) / SecondsInDay <= 5
  810. EndProc
  811.  
  812.  
  813. Procedure SelectServer
  814.    DrawBox 25 9 20 NumberOfElements (Servers) + 2
  815.    MyServer = PickOne (Servers)
  816.    NovSetPrimaryServer (MyServer)
  817.    NovSetPreferredServer (MyServer)
  818.    EraseTopWindow
  819.    UpdateStatusWindow
  820. EndProc
  821.  
  822.  
  823. Procedure UpdateStatusWindow
  824.    SetTopWindow StatusWin
  825.    ClearScreen
  826.    NetAddress = NovStationAddress (NovConnection)
  827.    Station = Str(NovConnection)
  828.    while length(Station) < 3
  829.       Station = '0' + Station
  830.    endwhile
  831.    Writeln '           Server: ' MyServer
  832.    Writeln '          Network: ' NetAddress
  833.    Writeln '       Connection: ' Station
  834.    Write   '      DOS Version: ' DosVersionString
  835.    if StatusWin <> CurrentWindow
  836.       SetWindowUnder (StatusWin,StatusWin + 1)
  837.    endif
  838. EndProc
  839.  
  840.  
  841. Procedure AfterHours
  842.    Return (DayOfWeek = Sun) or (DayOfWeek = Sat) or (Hour > 17) or (Hour < 7)
  843. EndProc
  844.  
  845. ;----- Show Item for Debugging
  846.  
  847. Procedure ShowMe (Item)
  848.    DrawBox 1 23 80 3
  849.    Write ' '
  850.    TextColor Yellow Cyan
  851.    Write Item
  852.    Wait 300
  853.    EraseTopWindow
  854. EndProc
  855.  
  856.